package joc.customize;

import java.lang.annotation.Annotation;

import joc.internal.util.GenericTypeAware;

public abstract class Contract<T extends Annotation> extends GenericTypeAware<T> {
	public Class<T> getAnnotationClass() {
		return getGenericClass();
	}

	protected PartialEvaluationResult getFailure(String errorMessage) {
		return new PartialEvaluationResult(getAnnotationClass(), false, errorMessage);
	}

	protected PartialEvaluationResult getSuccess() {
		return new PartialEvaluationResult(getAnnotationClass(), true, "");
	}

	protected PartialEvaluationResult getResult(boolean success, String errorMessage) {
		return new PartialEvaluationResult(getAnnotationClass(), success, errorMessage);
	}
}
